package com.vcredit.creditcat.web.app;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.vcredit.creditcat.api.IForeignTradeComplianceManager;
import com.vcredit.creditcat.model.Cust;
import com.vcredit.creditcat.vo.JsonResult;
import com.vcredit.creditcat.vo.SignatureVo;
import com.vcredit.framework.annotation.Log;

/**
 * 机构版征信相关处理
 */
@RestController
@RequestMapping("/creditAssure")
public class CreditAssureController extends BaseCreditCatController {
	
	@Reference(version = "1.0")
    private IForeignTradeComplianceManager foreignTradeManager;

	/**
	 * 机构版征信手写签名
	 * 
	 * @param request
	 * @param paramDto UpdateUserNameDto
	 * @return
	 * @throws Exception
	 */
	@Log
	@RequestMapping(value = "/saveSignature")
	public JsonResult<?> saveSignature(@RequestBody SignatureVo paramDto, HttpServletRequest request) throws Exception {				
		Cust currentCust = super.getCust(request);
		foreignTradeManager.signatureImgUpload(paramDto.getSignPhotoData(),paramDto.getProductId(), currentCust.getLastProccessId());		
		return JsonResult.SuccessResponse(null);
	}
	
	/**
	 * 机构版征信授权
	 * 
	 * @param request
	 * @param paramDto UpdateUserNameDto
	 * @return
	 * @throws Exception
	 */
/*	@Log
	@RequestMapping(value = "/creditAuth")
	public JsonResult<?> creditAuth( HttpServletRequest request) throws Exception {				
		Cust currentCust = super.getCust(request);
		foreignTradeManager.creditAuth(currentCust.getLastProccessId());		
		return JsonResult.SuccessResponse(null);
	}*/
}
